package com.example.demo.model;

import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;

@Data
public class ProductInfo {
    private Integer id;
    private Integer sellerId;
    private String name;
    private BigDecimal price;
    private BigDecimal originalPrice;
    private Integer categoryId;
    private String categoryPath;
    private String description;
    private Integer conditionLevel;  // 新旧程度：5-全新 4-几乎全新 3-轻微使用 2-明显使用 1-重度使用
    private String images;  // JSON格式的图片URL字符串
    private Integer status;
    private Integer viewCount;
    private Integer favoriteCount;
    private Date createTime;
    private Date updateTime;
    private String nickname;
    private String sellerAvatar;
    private String brand;
    private String location;
    private Integer shippingFee;
    private Integer isAuction;

    // 用于接收上传的文件，但不会被保存到数据库
    @JsonIgnore  // 在JSON序列化时忽略这个字段
    private transient List<MultipartFile> imageFiles;

    public String getSellerAvatar() {
        return sellerAvatar;
    }

    public void setSellerAvatar(String sellerAvatar) {
        this.sellerAvatar = sellerAvatar;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public void setIsAuction(Integer isAuction) {
        this.isAuction = isAuction;
    }
}
